package chap7;

import java.util.Iterator;
import java.util.SortedSet;
import java.util.TreeSet;

public class SortedSetTest {
	public static void main(String arg[]){
		SortedSet intSet=new TreeSet();
		intSet.add(new Integer(50));
		intSet.add(new Integer(25));
		intSet.add(new Integer(100));
		intSet.add(new Integer(-15));
		System.out.println(intSet.first());
		System.out.println(intSet.last());

		SortedSet subSet=intSet.tailSet(new Integer(25));
		Iterator it=subSet.iterator();
		while(it.hasNext()){
		    System.out.println(it.next());
		}

	}
}
